package microservicedemo.borrowclient.Client;

import microservicedemo.borrowclient.model.BorrowRecord;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


import java.util.List;

@FeignClient(name="borrow-service",fallback = BorrowServiceFallback.class)
public interface BorrowServiceClient {

    @PostMapping("/borrowBook")
    public void borrowBook(@RequestBody BorrowRecord borrowRecord);

    @PostMapping("/returnBook")
    public boolean returnBook(@RequestBody BorrowRecord borrowRecord);

    @GetMapping("/getOverdueBook")
    public List<BorrowRecord> getOverdueBook();
}
